package com.shop.enumeration;

/**
 * 
 * @author wenjuanhenxing
 * @version V1.0 MessageStatusEnum.java 2016-2-20 下午6:55:27
 */
public enum MessageStatusEnum {
	UNREAD(0, "未读"), READ(1, "已读");
	private int key;
	private String desc;

	private MessageStatusEnum(int key, String desc) {
		this.key = key;
		this.desc = desc;
	}

	public int getKey() {
		return key;
	}

	public void setKey(int key) {
		this.key = key;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public static String getDescByKey(int key) {
		for (MessageStatusEnum msgEnum : MessageStatusEnum.values()) {
			if (msgEnum.getKey() == key) {
				return msgEnum.getDesc();
			}
		}
		return null;
	}
}
